import createAxios, {getUrl} from '/@/utils/axios'
export const apiUrl = '/api/ai.group';

export function getGroup(search = '', page: number, pageSize: number) {
    return createAxios({
        url: apiUrl + '/index',
        method: 'get',
        params: {
            title : search,
            page: page,
            limit: pageSize,
        },
    })
}

// 创建分组
export function createGroup(title: string) {
    return createAxios({
        url: apiUrl + '/create',
        method: 'post',
        data: {
            title: title,
        },
    })
}

// 修改分组
export function saveGroup(params: any) {
    return createAxios({
        url: apiUrl + '/update',
        method: 'post',
        data: params
    })
}

// 删除分组
export function deleteGroup(group_id: number) {
    return createAxios({
        url: apiUrl + '/delete',
        method: 'post',
        data: {
            id: group_id,
        },
    })
}

// 获取组模型
export function getGroupModel(group_id: number) {
    return createAxios({
        url: apiUrl + '/get_group_model',
        method: 'get',
        params: {
            group_id: group_id,
        }
    }, {
        showCodeMessage: false,
    })
}
